package com.demo.config;


import com.demo.interceptor.TestInterceptorOne;
import com.demo.interceptor.TestInterceptorTwo;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author zhangxiangnan
 * @date 2021/8/18  23:01
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new TestInterceptorOne())
                .addPathPatterns("/**");
        registry.addInterceptor(new TestInterceptorTwo())
                .addPathPatterns("/**");
    }
}
